home *** CD-ROM | disk | FTP | other *** search
- Path: isar.de!news
- From: imd@m.isar.de (Thomas Doerfler)
- Newsgroups: comp.sys.m68k
- Subject: Re: BSR vs. JSR
- Date: Fri, 05 Jan 1996 08:47:53 GMT
- Organization: IMD
- Message-ID: <4ciod6$nko@nixe.isar.net>
- References: <30EBF0B3.6749@bmdl2.bbn.hp.com> <ludisDKozAI.7pL@netcom.com>
- NNTP-Posting-Host: imd.m.isar.de
- X-Newsreader: Forte Free Agent 1.0.82
-
- ludis@netcom.com (Ludis Langens) wrote:
-
- >In article <30EBF0B3.6749@bmdl2.bbn.hp.com> Ernst Geesmann <praktwg@bmdl2.bbn.hp.com> writes:
- >>My software uses BSR and JSR instructions. Everything's fine if
- >>the stack is placed into SRAM. But if I place the stack into DRAM
- >>strange things happen:
- >>On BSR the return address is pushed to the stack - OK
- >>Several BSR follow, each time return address is pushed and
- >>can be pulled - OK
- >>A JSR is used, return address pushed - OK
- >>With the first BSR after this JSR only the lower 16 bit of the
- >>return address is pushed to the stack, but the stack pointer is
- >>moved for 4 furthter bytes.
-
- >Three ideas:
- > 1) You have a memory trashing bug.
-
- > 2) Your BSRs/JSRs aren't written correctly to deal with 32 bit addresses:
- > You might have exceeded the range of a BSR.W (and your assembler
- > didn't catch it.) Partial address decoding might make the code
- > run, but the upper word of the PC is wrong.
- > You used JSR <ABS.W> where JSR <ABS.L> is needed.
-
- This cannot be, because errors in the target address of a BSR or JSR
- would branch (jump) to the wrong address but would _not_ generate a
- wrong return address! And return addresses on the stack are always 32
- bit long.
-
- > 3) You have a memory timing bug (maybe a refresh problem) that just
- > happens to show up where you found it (i.e. it has nothing to do
- > with BSR vs JSR.)
-
- Quite probable to me, maybe you used optimized page mode for the DRAM
- and you get timing problems...
-
-
- >I'd say that #1 is the most likely problem...
-
- Another possibility: You have some kind of error in your memory
- configuration (you have set a bank to 32 bit or so...).
- Some questions:
- Can it be that the first return address corrupted is the first one
- that is pushed to a stack location not divisible by 4?
- How do you set your memory banks to 16 bit? Do you use the BUSW pin?
- And what mask version of the MC68360 do you have?
-
- By, Thomas.
-
- --------------------------------------------
- IMD Ingenieurbuero fuer Microcomputertechnik
- Thomas Doerfler Elilandstrasse 12
- D-81547 Muenchen Germany
- email: imd@m.isar.de
-
-